<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title></title>
</head>
<body>
	<div onlick="fn()"></div>
	<script type="text/javascript">
		let div = document.querySelector('div')
		function fn(){
			div.style.background = 'red'
		}
	</script>
</body>
</html>